import React, { useEffect } from "react";
import { Outlet, useLoaderData } from "react-router-dom";
// import useBtnIsAuth from "../../hooks/useBtnIsAuth";

function Order() {
    // const isAdd = useBtnIsAuth('add')
    // const isAdd = useBtnIsAuth('edit')
    // const isAdd = useBtnIsAuth('delete')
    // console.log(isAdd)


    // const loaderData = useLoaderData()
    // const isOk = loaderData.includes('add')
    // const isOk = loaderData.includes('edit')
    // const isOk = loaderData.includes('delete')

    // useEffect(() =>{
    //   const ws = new WebSocket('ws://81.70.224.2:8003/koa/ws?user_id=111&server_id=300')

    //   // 链接成功了
    //   ws.onopen = () => {
    //     console.log('object')
    //   }
    // }, [])

    return (
        <div>
            Order
            <Outlet />
        </div>
    );
}

export default Order;
